<template>
	<div class="title">
		<div style="float: left;">
			{{title}}
		</div>
		<div style=" float: right;margin-right: 50px;" v-if="title == '首页'">
			<el-input placeholder="请输入学生名称/电话" v-model="xsxx" style="width: 350px;"  @keyup.enter.native="search">
				<el-select v-model="select" slot="prepend"  style="width: 80px;">
					<el-option label="学生" value="1"></el-option>
					<el-option label="物品" value="2"></el-option>
				</el-select>
				<el-button slot="append" icon="el-icon-search" @click='search()' style="width: 100%;text-align: center;"></el-button>
			</el-input>
		</div>
	</div>
</template>

<script type="text/javascript">
	export default {
		props: ['title'],
		data() {
			return {
				xsxx:'',
				select:'1',
			}
		},
		methods: {
			search(){
				var str = this.xsxx.replace(/^\s+|\s+$/g,"")
				if(str){
					this.$router.push({ name: 'syxslist', query: { xsxx:str }})
				}
			}
		}
	}
</script>
<style lang="less" scoped>
	.title {
		line-height: 40px;
		padding-left: 1.5em;
		-moz-box-shadow: 0px 5px 5px #EBDFDD;
		-webkit-box-shadow: 0px 5px 5px #EBDFDD;
		box-shadow: 0px 5px 5px #EBDFDD;
		color: #56606D;
		background: #fff;
		overflow: hidden;
	}
</style>